
# 搜索模块的测试用例
import time
import unittest

from selenium.webdriver.common.by import By
from common.myTest import MyTest

from common.driver import Driver
from common.readData import ReadData
rd=ReadData()

class SearchTest(MyTest):

    def test_normal_len(self):
        cname=self.__class__.__name__
        mname=self._testMethodName
        data=rd.read_excel(cname,mname)
        time.sleep(10)
        # 点击搜索框
        self.sp.clickSearchbox()
        # 输入搜索框
        self.sp.inputSearchbox(data)
        # 点击搜索按钮
        self.sp.clickSearchbut()

        # # 断言
        # page=self.driver.page_source
        # num=page.count(data)
        # self.assertGreater(num,2)
    def test_max_len(self):
        cname=self.__class__.__name__
        mname=self._testMethodName
        time.sleep(10)
        # 点击搜索框
        self.sp.clickSearchbox()
        # 输入搜索框
        # 点击搜索按钮
        self.sp.clickSearchbut()

        # page=self.driver.page_source
        # num=page.count(data)
        # self.assertGreater(num,2)
    def test_min_len(self):
        cname = self.__class__.__name__
        mname = self._testMethodName
        data = rd.read_excel(cname, mname)
        time.sleep(10)
        # 点击搜索框
        self.sp.clickSearchbox()
        # 输入搜索框
        self.sp.inputSearchbox(data)
        # 点击搜索按钮
        self.sp.clickSearchbut()

        # page=self.driver.page_source
        # num=page.count(data)
        # self.assertGreater(num,2)
if __name__ == '__main__':
    unittest.main(verbosity=1)